#ifndef VEC3F_H_INCLUDED
#define VEC3F_H_INCLUDED

#include <iostream>
#include <gl\glut.h>

class Vec3f
{
	private:
		GLfloat v[3];
	public:
		Vec3f();
		Vec3f(GLfloat x, GLfloat y, GLfloat z);
		
		GLfloat &operator[](GLint index);
		GLfloat operator[](GLint index) const;
		
		Vec3f operator*(GLfloat scale) const;
		Vec3f operator/(GLfloat scale) const;
		Vec3f operator+(const Vec3f &other) const;
		Vec3f operator-(const Vec3f &other) const;
		Vec3f operator-() const;
		
		const Vec3f &operator*=(GLfloat scale);
		const Vec3f &operator/=(GLfloat scale);
		const Vec3f &operator+=(const Vec3f &other);
		const Vec3f &operator-=(const Vec3f &other);
		
		GLfloat magnitude() const;
		GLfloat magnitudeSquared() const;
		Vec3f normalize() const;
		GLfloat dot(const Vec3f &other) const;
		Vec3f cross(const Vec3f &other) const;
};

Vec3f operator*(GLfloat scale, const Vec3f &v);
std::ostream &operator<<(std::ostream &output, const Vec3f &v);


#endif
